\name{Sp2Geometry}
\alias{Sp2Geometry}
\encoding{UTF-8}
\title{
sp spatial geometry objects into SuperMap Geometry objects
}
\description{
将 sp 的 SpatialPoints、SpatialLines 和 SpatialPolygons 转换为 SuperMap 的 GeoPoint、GeoLine 或 GeoRegion 的集合。
}
\usage{
Sp2Geometry(obj)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{obj}{
  sp 空间几何对象，可以为 SpatialPoints、SpatialLines 和 SpatialPolygons。
}
}
\details{
}
\value{
如果是 SpatialPoints，则返回包含 GeoPoint 的 list，
如果是 SpatialLines，则返回包含 GeoLine 的 list，
如果是 SpatialPolygons，则返回包含 GeoRegion 的 list。
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%%  ~~who you are~~
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
\code{\link{Geometry2Sp}}
}
\examples{

require(sp)

set.seed(1331)
pts <- cbind(1:10, 1:10)
p1 <- SpatialPoints(pts)
geo.pnts <- Sp2Geometry(p1)

l1 <- cbind(c(1,2,3),c(3,2,2))
rownames(l1) <- letters[1:3]
l1a <- cbind(l1[,1]+.05,l1[,2]+.05)
rownames(l1a) <- letters[1:3]
l2 <- cbind(c(1,2,3),c(1,1.5,1))
rownames(l2) <- letters[1:3]
Sl1 <- Line(l1)
Sl1a <- Line(l1a)
Sl2 <- Line(l2)
S1 <- Lines(list(Sl1, Sl1a), ID="1")
S2 <- Lines(list(Sl2), ID="2")
Sl <- SpatialLines(list(S1,S2))
geo.lines <- Sp2Geometry(Sl)


Sr1 <- Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))
Sr2 <- Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))
Sr3 <- Polygon(cbind(c(4,4,5,10,4),c(5,3,2,5,5)))
Sr4 <- Polygon(cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE)
Srs1 <- Polygons(list(Sr1), "s1")
Srs2 <- Polygons(list(Sr2), "s2")
Srs3 <- Polygons(list(Sr3, Sr4), "s3/4")
SpP <- SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3)
geo.regions <- Sp2Geometry(SpP)
}

% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ supermap }% __ONLY ONE__ keyword per line

